﻿using SD.Infrastructure.Repository.EntityFrameworkCore;
using SlamDunk.MES.Domain.Entities.ResourceContext;
using SlamDunk.MES.Domain.IRepositories.Interfaces.ResourceContext;
using System;
using System.Collections.Generic;
using System.Linq;

namespace SlamDunk.MES.Repository.Implements.ResourceContext
{
    /// <summary>
    /// 班组成员仓储实现
    /// </summary>
    public class TeamMemberRepository : EFEntityRepositoryProvider<TeamMember>, ITeamMemberRepository
    {
        #region # 获取班组成员列表 —— ICollection<TeamMember> Find(Guid teamId)
        /// <summary>
        /// 获取班组成员列表
        /// </summary>
        /// <param name="teamId">班组Id</param>
        /// <returns>班组成员列表</returns>
        public ICollection<TeamMember> Find(Guid teamId)
        {
            IQueryable<TeamMember> teamMembers = base.Find(x => x.Team.Id == teamId);

            return teamMembers.ToList();
        }
        #endregion
    }
}
